Inferring Alias Contracts in VCC using Separation Analysis
نویسندگان
چکیده
The main goal of this work is to enable an interplay between two different verification tool chains: Frama-C, developed concomitantly by Commissariat à l’Énergie Atomique et aux Énergies Alternatives and Inria, and the Verified C Compiler, developed by Microsoft Research. Both tools have a long history and contain powerful algorithms for static verification of C source code. Both tools address the problem of aliasing, where the memory representation of two or more variables overlap (partial aliasing) or even is shared entirely (full aliasing). Aliasing is a common problem in software verification, for it produces side effects during code analysis by changing the values of variables that were not explicitly (re-)assigned. This problem is apparent in weakly typed languages like C and requires special attention. The byte-level memory model of VCC is tuned narrowly to the verification of concurrent programs, but this memory model turns out not to be optimal for alias detection and memory safety checks. Frama-C and its plug-in Jessie, on the other hand, implement deductive verification using a region-based memory representation, which is better suited for separation and alias analysis. We use the memory safety analysis of Jessie to derive missing pre-conditions in our VCC specification that enforce memory safety. To implement the necessary constraints in VCC, we have to confine alias detection to aliases of primitive data types and consider only full aliasing. These assumptions allows us to express the aliasing condition in the form of pointer inequality: two variables are not aliased, if their pointers are unequal. The main contribution of this thesis is Jessifier, a command-line utility for automated inference of missing alias contracts implemented in C#. This utility uses the outcome of the analysis performed by Jessie to detect possibly missing VCC annotations and attempts to generate them automatically (to infer). This inference is only possible if aliases are directly present in function invocations in the source code. If not, the respective verification conditions turn into tautologies and eliminated by Jessie from the analysis output.
منابع مشابه
VCC: A Practical System for Verifying Concurrent C
VCC is an industrial-strength verification environment for low-level concurrent system code written in C. VCC takes a program (annotated with function contracts, state assertions, and type invariants) and attempts to prove the correctness of these annotations. It includes tools for monitoring proof attempts and constructing partial counterexample executions for failed proofs. This paper motivat...
متن کاملAccess contracts: a dynamic approach to object-oriented access protection
In object-oriented (OO) programming, variables do not contain objects directly but ad-dresses of objects on the heap. Thus, several variables can point to the same object; wecall this aliasing.Aliasing is a central feature of OO programming that enables efficient sharing of objectsacross a system. This is essential for the implementation of many programming idioms,such as it...
متن کاملDynamic Alias Protection with Aliasing Contracts
Object-oriented languages allow any object to point to any other object, limited only by type. The resultant possible aliasing makes programs hard to verify and maintain. Much research has been done on alias protection schemes to restrict aliasing. However, existing schemes are either informal (design-patternlike) or static type-like systems. The former are hard to verify, while the latter tend...
متن کاملAliasing contracts: a dynamic approach to alias protection
Object-oriented programming languages allow multiple variables to refer to the same object, a situation known as aliasing. Aliasing is a powerful tool which enables sharing of objects across a system. However, it can cause serious encapsulation breaches if not controlled properly; through aliasing, internal parts of aggregate objects can be exposed and potentially modified by any part of the sy...
متن کاملVerifying C Programs: A VCC Tutorial
VCC is a verification environment for software written in C. VCC takes a program (annotated with function contracts, state assertions, and type invariants) and attempts to prove that these annotations are correct, i.e. that they hold for every possible program execution. The environment includes tools for monitoring proof attempts and constructing partial counterexample executions for failed pr...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2011